# Generated by Django 4.0.3 on 2022-06-03 09:03

from django.conf import settings
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import tests.models.base
import tests.models.user


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('email', models.EmailField(max_length=254)),
                ('first_name', models.CharField(max_length=30, verbose_name='Имя')),
                ('last_name', models.CharField(max_length=30, verbose_name='Фамилия')),
                ('avatar', models.ImageField(default='avatar.png', upload_to=tests.models.user.user_media_path, verbose_name='Аватарка')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='ChronologyExercise',
            fields=[
                ('name', models.CharField(max_length=50, verbose_name='Название упражнения')),
                ('title', models.CharField(max_length=150, null=True, verbose_name='Заголовок')),
                ('exercise_id', models.IntegerField(primary_key=True, serialize=False, unique=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ColumnMatchExercise',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.CharField(max_length=100)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MatchExercise',
            fields=[
                ('name', models.CharField(max_length=50, verbose_name='Название упражнения')),
                ('title', models.CharField(max_length=150, null=True, verbose_name='Заголовок')),
                ('exercise_id', models.IntegerField(primary_key=True, serialize=False)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='New test', max_length=100, verbose_name='Название')),
                ('description', models.TextField(default='Description', verbose_name='Описание')),
                ('icon', models.ImageField(default='test_icon.png', upload_to=tests.models.base.user_media_path)),
                ('number_of_tasks', models.IntegerField(default=0, verbose_name='Количество заданий')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('project_name', models.CharField(max_length=100, verbose_name='Название проекта')),
                ('published', models.BooleanField(default=False)),
                ('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ProjectTask',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('number', models.IntegerField(verbose_name='Номер задания')),
                ('title', models.TextField(default='New Task', verbose_name='Заголовок')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
                ('project', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='tests.project')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ProjectTaskElement',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('element_type', models.IntegerField(choices=[(0, 'exercise'), (1, 'title'), (2, 'image'), (3, 'map')], default=0, verbose_name='Тип элемента')),
                ('element_id', models.IntegerField(primary_key=True, serialize=False)),
                ('task', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='tests.projecttask')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Test',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='New test', max_length=100, verbose_name='Название')),
                ('description', models.TextField(default='Description', verbose_name='Описание')),
                ('icon', models.ImageField(default='test_icon.png', upload_to=tests.models.base.user_media_path)),
                ('number_of_tasks', models.IntegerField(default=0, verbose_name='Количество заданий')),
                ('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ProjectExercise',
            fields=[
                ('projecttaskelement_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='tests.projecttaskelement')),
                ('exercise_type', models.IntegerField(choices=[(0, 'Ответить на вопрос'), (1, 'Написать развёрнутый ответ'), (2, 'Отметить верные утверждения'), (3, 'Выбрать одно верное утверждение'), (4, 'Соотнести что-то с чем-то'), (5, 'Составить правильный порядок карточек')], default=0)),
            ],
            options={
                'abstract': False,
            },
            bases=('tests.projecttaskelement',),
        ),
        migrations.CreateModel(
            name='VariantMatchExercise',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.CharField(max_length=100)),
                ('column', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='tests.columnmatchexercise')),
                ('exercise', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tests.matchexercise')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VariantChronologyExercise',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField()),
                ('order', models.IntegerField(verbose_name='Порядковый номер')),
                ('exercise', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tests.chronologyexercise')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TestFact',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('started_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('finished_at', models.DateTimeField(null=True)),
                ('completed', models.BooleanField(default=False)),
                ('test', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='tests.test')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='person', to=settings.AUTH_USER_MODEL, verbose_name='Испытуемый')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TestComment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('message', models.TextField()),
                ('published_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('test', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tests.test')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('number', models.IntegerField(verbose_name='Номер задания')),
                ('title', models.TextField(default='New Task', verbose_name='Заголовок')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
                ('test', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='tests.test', verbose_name='Тест')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='columnmatchexercise',
            name='exercise',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tests.matchexercise'),
        ),
        migrations.CreateModel(
            name='ProjectChronologyExercise',
            fields=[
                ('projectexercise_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, to='tests.projectexercise')),
                ('chronologyexercise_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='tests.chronologyexercise')),
            ],
            options={
                'abstract': False,
            },
            bases=('tests.chronologyexercise', 'tests.projectexercise'),
        ),
        migrations.CreateModel(
            name='ProjectMatchExercise',
            fields=[
                ('projectexercise_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, to='tests.projectexercise')),
                ('matchexercise_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='tests.matchexercise')),
            ],
            options={
                'abstract': False,
            },
            bases=('tests.matchexercise', 'tests.projectexercise'),
        ),
    ]
